<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" th:href="@{/lib/layui-v2.5.5/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
    <style>
        .top-panel {
            border: 1px solid #eceff9;
            border-radius: 5px;
            text-align: center;
        }
        .top-panel > .layui-card-body{
            height: 60px;
        }
        .overflow-hiding {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
    </style>
</head>
<body>
<div class="layuimini-main">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md3" id="party">
            <div class="layui-card top-panel">
                <div class="layui-card-header">党史</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space5 overflow-hiding" style="text-indent:2em;">
                        <p>1921—2021，中国共产党建党100周年。100年来，中国社会沧桑巨变。从石库门到天安门，从兴业路到复兴路，从站起来、富起来到强起来,</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-md3">
            <div class="layui-card top-panel" id="newChina">
                <div class="layui-card top-panel">
                    <div class="layui-card-header">新中国史</div>
                    <div class="layui-card-body">
                        <div class="layui-row layui-col-space5 overflow-hiding" style="text-indent:2em;">
                            <p>1949年10月1日下午，毛主席在北京天安门城楼上向全世界庄严宣告：“中华人民共和国中央人民政府今天成立了！”</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-md3" id="reform">
            <div class="layui-card top-panel">
                <div class="layui-card-header">改革开放史</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space5 overflow-hiding" style="text-indent:2em;">
                        <p>1978年12月18日，党的十一届三中全会在北京召开，开启了改革开放的序幕。这次会议是1949年以来中国共产党历史上具有深远意义的重要转折。</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-md3" id="socialist">
            <div class="layui-card top-panel">
                <div class="layui-card-header">社会主义发展史</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space5 overflow-hiding" style="text-indent:2em;">
                        <p>习近平总书记多次强调广大党员干部要学好“四史”，“四史”中社会主义发展史是时间跨度最长的。学习社会主义发展史是为了从源头上弄清楚社会主义从哪里来</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md9">
            <div id="echarts-records" style="background-color:#ffffff;min-height:460px;padding: 10px"></div>
        </div>
        <div class="layui-col-xs12 layui-col-md3">
            <div id="echarts-pies" style="background-color:#ffffff;min-height:460px;padding: 10px"></div>
        </div>
    </div>

</div>
<!--</div>-->
<script th:src="@{/lib/layui-v2.5.5/layui.js}" charset="utf-8"></script>
<script th:src="@{/js/lay-config.js?v=1.0.4}" charset="utf-8"></script>
<script>
    layui.use(['layer', 'echarts'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            echarts = layui.echarts;

        /**
         * 报表功能
         */
        var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');

        var optionRecords = {
            title: {
                text: '指标名称-报表图'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                }
            },
            legend: {
                data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: '邮件营销',
                    type: 'line',
                    stack: '总量',
                    areaStyle: {},
                    data: [120, 132, 101, 134, 90, 230, 210]
                },
                {
                    name: '联盟广告',
                    type: 'line',
                    areaStyle: {},
                    data: [220, 182, 191, 234, 290, 330, 310]
                },
                {
                    name: '视频广告',
                    type: 'line',
                    stack: '总量',
                    areaStyle: {},
                    data: [150, 232, 201, 154, 190, 330, 410]
                },
                {
                    name: '直接访问',
                    type: 'line',
                    stack: '总量',
                    areaStyle: {},
                    data: [320, 332, 301, 334, 390, 330, 320]
                },
                {
                    name: '搜索引擎',
                    type: 'line',
                    stack: '总量',
                    label: {
                        normal: {
                            show: true,
                            position: 'top'
                        }
                    },
                    areaStyle: {},
                    data: [820, 932, 901, 934, 1290, 1330, 1320]
                }
            ]
        };
        echartsRecords.setOption(optionRecords);


        /**
         * 玫瑰图表
         */
        var echartsPies = echarts.init(document.getElementById('echarts-pies'), 'walden');
        var optionPies = {
            title: {
                text: '指标名称-玫瑰图',
                left: 'center'
            },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            legend: {
                orient: 'vertical',
                left: 'left',
                data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎']
            },
            series: [
                {
                    name: '访问来源',
                    type: 'pie',
                    radius: '55%',
                    center: ['50%', '60%'],
                    roseType: 'radius',
                    data: [
                        {value: 335, name: '直接访问'},
                        {value: 310, name: '邮件营销'},
                        {value: 234, name: '联盟广告'},
                        {value: 135, name: '视频广告'},
                        {value: 368, name: '搜索引擎'}
                    ],
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        echartsPies.setOption(optionPies);


        // echarts 窗口缩放自适应
        window.onresize = function () {
            echartsRecords.resize();
        }

        $("#socialist").bind("click",function(){
            window.location.href = "/back/welcome/socialist";
        });

        $("#newChina").bind("click",function(){
            window.location.href = "/back/welcome/new/china";
        });

        $("#reform").bind("click",function(){
            window.location.href = "/back/welcome/reform";
        });

        $("#party").bind("click",function(){
            window.location.href = "/back/welcome/party";
        });

    });
</script>
</body>
</html>
